FPTHREAD = -pthread
FGMP = -lgmp
FMATH = -lm
OBJS = obj/rand.o

main :
	$(info Usage: make ( bin/main | bin/(borwein | gauss2 | gauss4 | monteCarlo)Par | bin/(borwein | gauss | monteCarlo)Seq))

bin/main : src/main.c bin/borweinPar bin/borweinSeq bin/gauss2Par bin/gauss4Par bin/gaussSeq bin/monteCarloPar bin/monteCarloSeq
	$(CC) src/main.c -o bin/main

bin/borweinPar : src/borweinPar.c
	$(CC) src/borweinPar.c -o bin/borweinPar $(FPTHREAD) $(FGMP)

bin/borweinSeq : src/borweinSeq.c
	$(CC) src/borweinSeq.c -o bin/borweinSeq $(FGMP)

bin/gauss2Par : src/gauss2Par.c
	$(CC) src/gauss2Par.c -o bin/gauss2Par $(FPTHREAD) $(FGMP)

bin/gauss4Par : src/gauss4Par.c
	$(CC) src/gauss4Par.c -o bin/gauss4Par $(FPTHREAD) $(FGMP)

bin/gaussSeq : src/gaussSeq.c
	$(CC) src/gaussSeq.c -o bin/gaussSeq $(FGMP)

bin/monteCarloPar : src/monteCarloPar.c obj/rand.o
	$(CC) src/monteCarloPar.c $(OBJS) -o bin/monteCarloPar $(FPTHREAD) $(FMATH)

bin/monteCarloSeq : src/monteCarloSeq.c obj/rand.o
	$(CC) src/monteCarloSeq.c $(OBJS) -o bin/monteCarloSeq $(FMATH)

obj/rand.o : src/rand.c
	$(CC) -c src/rand.c -o obj/rand.o

clean :
	rm -r obj/*.o bin/*